<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
    require([ "dojo/_base/array", "dojo/_base/xhr", "dojo/request", "dojo/topic", "dojo/json" ],
            function(array, xhr, request, topic, JSON) {
                var deletItemsCount = 0;
                calendarplanRestForm = function(formId) {
                    dijit.byId(formId).reset();
                    //reset无法将内容清空 此处手动清空
                    dijit.byId("CalendarPlanNewContent").setValue("");
                    dijit.byId("CalendarPlanUpdateContent").setValue("");
                    document.getElementById("ICalendarPlanStartTime").value="";
                    document.getElementById("ICalendarPlanEndTime").value="";
                    document.getElementById("UCalendarPlanStartTime").value="";
                    document.getElementById("UCalendarPlanEndTime").value="";
                    if (formId.indexOf('UFD') != -1) {
                        var rowid = jQuery("#calendarplanGird").jqGrid('getGridParam', 'selrow');
                        var calendarplan = jQuery("#calendarplanGird").jqGrid('getRowData', rowid);
                        dijit.byId('calendarplanUFD').setValues(calendarplan);
                    }
                };
                topic.subscribe("calendarplan/insertOrUpdate", calendarplanRestForm);
                var syncDB = function(url, jsonData) {
                    request.post(url, {
                        data : jsonData,
                        headers : {
                            'Content-Type' : "application/json; charset=utf-8"
                        },
                        timeout : 30000
                    }).then(function(response) {
                        topic.publish("notifyMsgTopic", {
                            message : response,
                            type : "message",
                            duration : 1000
                        });
                        var currentPage = jQuery('#calendarplanGird').jqGrid('getGridParam', 'page');
                        var pageSize = jQuery('#calendarplanGird').jqGrid('getGridParam', 'rowNum');
                        var totalCount = jQuery('#calendarplanGird').jqGrid('getGridParam', 'records') - deletItemsCount;
                        var totalPages = Math.ceil(totalCount / pageSize);
                        jQuery("#calendarplanGird").jqGrid('setGridParam', {
                            page : currentPage > totalPages ? totalPages : currentPage
                        }).trigger("reloadGrid");
                    }, function(error) {
                        alert(error);
                    });
                };
                calendarplanSubmitForm = function(formId, type) {
                    setValueToHidden("ICalendarPlanStartTime","_ICalendarPlanStartTime");
                    setValueToHidden("ICalendarPlanEndTime","_ICalendarPlanEndTime");
                                        
                    setValueToHidden("UCalendarPlanStartTime","_UCalendarPlanStartTime");
                    setValueToHidden("UCalendarPlanEndTime","_UCalendarPlanEndTime");
                    var url = "calendarplan/insert";
                    if (type == 'u') {
                        url = "calendarplan/update";
                    }
                    //只更新status planid feedback字段
                    if (type == 'f') {
                        url = "calendarplan/finish";
                        var form = dijit.byId(formId);
                        if (form.isValid()) {
                            var planid=dijit.byId("planid").getValue();
                            var feedback=dijit.byId("feedback").getValue();
                            var json = '{ "planid":"'+planid+'","status":"1","feedback":"'+feedback+'"}';
                            syncDB(url, json);
                            form.hide();
                            topic.publish("calendarplan/insertOrUpdate", formId);
                        } else {
                            form.validate();
                        }
                        return;
                    }
                    var form = dijit.byId(formId);
                    if (form.isValid()) {
                        var json = JSON.stringify(form.getValues());
                        syncDB(url, json);
                        form.hide();
                        topic.publish("calendarplan/insertOrUpdate", formId);
                    } else {
                        form.validate();
                    }
                };
                calendarplanDelete = function() {
                    var ids = jQuery("#calendarplanGird").jqGrid('getGridParam', 'selarrrow') || [];
                    deletItemsCount = ids.length;
                    if (ids.length > 0) {
                        if (confirm('确认删除所选定的项？')) {
                            var calendarplan = {};
                            calendarplan.id = '';
                            array.forEach(ids, function(entry, i) {
                                calendarplan.id += entry + ",";
                            });
                            syncDB("calendarplan/delete", JSON.stringify(calendarplan));
                        }
                    } else {
                        alert('请选择至少一条数据!');
                    }
                };
                calendarplanQuery = function(formId) {
                    var calendarplan = dijit.byId(formId).getValues();
                    jQuery("#calendarplanGird").jqGrid('setGridParam', {
                        postData : calendarplan,
                        mtype : "post"
                    }).trigger('reloadGrid');
                };
                /*  控制开始时间结束时间的显示 */
                ITaskTypeChange= function(){
                    var ItaskTime =  document.getElementById("ItaskTime");
                    var InowValue =  dijit.byId("Itasktype").getValue();
                    var Istarttime=  dijit.byId("_ICalendarPlanStartTime");
                    var Iendtime=  dijit.byId("_ICalendarPlanEndTime");
                    if(InowValue==1){
                        ItaskTime.style.display="";
                        Istarttime.required=true;
                        Iendtime.required=true;
                    }else{
                        ItaskTime.style.display="none";
                        Istarttime.required=false;
                        Istarttime.setValue(" ");
                        document.getElementById("ICalendarPlanStartTime").value=" ";
                        Iendtime.required=false;
                        Iendtime.setValue(" ");
                        document.getElementById("ICalendarPlanEndTime").value=" ";
                    }
                    
                    
                };
                UTaskTypeChange= function(){
                    var UtaskTime =  document.getElementById("UtaskTime");
                    var UnowValue =  dijit.byId("Utasktype").getValue();
                    var Ustarttime=  dijit.byId("_UCalendarPlanStartTime");
                    var Uendtime=  dijit.byId("_UCalendarPlanEndTime");
                    
                    if(UnowValue==1){
                        UtaskTime.style.display="";
                        Ustarttime.required=true;
                        Uendtime.required=true;
                    }else{
                        UtaskTime.style.display="none";
                        Ustarttime.required=false;
                        Ustarttime.setValue(" ");
                        document.getElementById("UCalendarPlanStartTime").value=" ";
                        Uendtime.required=false;
                        Uendtime.setValue(" ");
                        document.getElementById("UCalendarPlanEndTime").value=" ";
                    }
                };
                //当焦点离开时间时候赋值给隐藏域
                setValueToHidden=function(displayMenber,valueMember){
                    var value=  dijit.byId(valueMember);
                    value.setValue(document.getElementById(displayMenber).value);
                    //alert(value.getValue());                    
                };
                //用于超链接显示详情 如果flag为1则是完成界面 内容框可编辑 如果为0则是详情页面内容框不可编辑
                   showDetail = function(flag,rowid){
                   var calendarplan = jQuery("#calendarplanGird").jqGrid('getRowData', rowid);
                   dijit.byId('calendarplanFFD').setValues(calendarplan);
                   dijit.byId('_feedback').setValue(calendarplan["feedback"]);
                   dijit.byId('calendarplanListfinish').setValue("1");
                   if(flag=="1"){
                       document.getElementById("inputfeedback").style.display="";
                       document.getElementById("showfeedback").style.display="none";
                       document.getElementById("CPLfinishBar").style.display="";
                   }else{
                       document.getElementById("inputfeedback").style.display="none";
                       document.getElementById("showfeedback").style.display="";
                       document.getElementById("CPLfinishBar").style.display="none";
                   }
                   dijit.byId('calendarplanFFD').show();
               };
            });
</script>
<div data-dojo-type="dijit/Dialog" id="calendarplanIFD" title="新增">
  <div class="dijitDialogPaneContentArea">
    <table>
      <tr>
        <td><label for="summary">摘要: </label></td>
        <td colspan="3"><input style="width: 327px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, trim:true" type="text"
          name="summary"></td>
      </tr>
      <tr>
        <td><label for="content">内容: </label></td>
        <td colspan="3">
            <div style="height: 75px;width: 322px" name="content" id="CalendarPlanNewContent" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="required: true,trim:true"></div>
        </td>
      </tr>
      <tr>
        <td><label for="fullname">员工名: </label></td>
        <td  colspan="3">
          <input id="ICalendarPlanUserSel" data-dojo-type="dijit/form/ValidationTextBox" name="fullname" data-dojo-props="required: true,trim:true,readOnly:true" style="width: 327px" type="text" onclick="showMenu('ICalendarPlanUserSel','ICalendarPlanUserId');" />
          <input id="ICalendarPlanUserId" data-dojo-type="dijit/form/ValidationTextBox" name="userid" type="hidden" ></td>
          
      </tr>
      <tr>
        <!-- 0=一般、1=重要、2=紧急:  -->
        <td><label for="urgent">紧急程度:</label></td>
        <td>
            <select data-dojo-type="dijit/form/Select" name="urgent" style="width: 125px;">
                 <option value="0">一般</option>
                 <option value="1">重要</option>
                 <option value="2">紧急</option>
            </select>
       </td>
       <!-- 1=限期任务、2=非限期任务:  -->
        <td><label for="Itasktype">任务类型:</label></td>
        <td><select data-dojo-type="dijit/form/Select" name="tasktype" id="Itasktype" style="width: 125px;" onchange="ITaskTypeChange()">
                 <option value="1">限期任务</option>
                 <option value="2">非限期任务</option>
            </select>
       </td>
      </tr>
      <tr>
        
      </tr>
    </table>
    <div id="ItaskTime">
        <table>
            <tr>
                <td>
                    <label for="Istarttime">开始时间: </label>
                </td>
                <td>
                    <input style="width: 325px;" type="text" name="starttime" class="Wdate" id="ICalendarPlanStartTime" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'ICalendarPlanEndTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" onblur="setValueToHidden(ICalendarPlanStartTime,'_ICalendarPlanStartTime')" >
                    <input type="hidden" data-dojo-type="dijit/form/ValidationTextBox" name="starttime" class="Wdate" id="_ICalendarPlanStartTime" >                    
                </td>
            </tr>
            <tr>
                <td>
                    <label for="Iendtime">结束时间: </label>
                </td>
                <td>
                    <input style="width: 325px;" type="text" name="endtime" class="Wdate" id="ICalendarPlanEndTime" onClick="WdatePicker({minDate:'#F{$dp.$D(\'ICalendarPlanStartTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" onblur="setValueToHidden(ICalendarPlanEndTime,'_ICalendarPlanEndTime')" >
                    <input type="hidden" data-dojo-type="dijit/form/ValidationTextBox" name="endtime" class="Wdate" id="_ICalendarPlanEndTime" >
                </td>
            </tr>
        </table>
    </div>
  </div>
  <div class="dijitDialogPaneActionBar">
    <button data-dojo-type="dijit/form/Button" type="button" onclick="calendarplanSubmitForm('calendarplanIFD','i')">保存</button>
    <button data-dojo-type="dijit/form/Button" type="button" onclick="calendarplanRestForm('calendarplanIFD');">重置</button>
  </div>
</div>
<div data-dojo-type="dijit/Dialog" id="calendarplanUFD" title="更新">
  <div class="dijitDialogPaneContentArea">
    <input data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, readOnly: true" type="text"
      name="planid" style="display: none;">
    <table>
      <tr>
        <td><label for="summary">摘要: </label></td>
        <td colspan="3"><input style="width: 327px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, trim:true" type="text"
          name="summary"></td>
      </tr>
      <tr>
        <td><label for="content">内容: </label></td>
        <td colspan="3">
            <div style="height: 75px;width: 322px" name="content" id="CalendarPlanUpdateContent" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="required: true, trim:true"></div>
        </td>
      </tr>
      <tr>
        <td><label for="fullname">员工名: </label></td>
        <td colspan="3"><!-- <input style="width: 327px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, trim:true" type="text"
          name="fullname"> -->
          <input id="UCalendarPlanUserSel" data-dojo-type="dijit/form/ValidationTextBox" name="fullname" data-dojo-props="required: true,trim:true,readOnly:true" style="width: 327px" type="text" onclick="showMenu('UCalendarPlanUserSel','UCalendarPlanUserId');" />
          <input id="UCalendarPlanUserId" data-dojo-type="dijit/form/ValidationTextBox" name="userid" type="hidden" ></td>
      </tr>
      <tr>
        <!-- 0=一般、1=重要、2=紧急:  -->
        <td><label for="urgent">紧急程度:</label></td>
        <td>
            <select data-dojo-type="dijit/form/Select" name="urgent" style="width: 125px;">
                 <option value="0">一般</option>
                 <option value="1">重要</option>
                 <option value="2">紧急</option>
            </select>
       </td>
       <!-- 1=限期任务、2=非限期任务:  -->
        <td><label for="Utasktype">任务类型:</label></td>
        <td><select data-dojo-type="dijit/form/Select" name="tasktype" id="Utasktype" style="width: 125px;" onchange="UTaskTypeChange()">
                 <option value="1">限期任务</option>
                 <option value="2">非限期任务</option>
            </select>
       </td>
      </tr>
    </table>
    <div id="UtaskTime">
         <table>
            <tr>
                <td>
                    <label for="Ustarttime">开始时间: </label>
                </td>
                <td>
                    <input style="width: 325px;" type="text" class="Wdate" id="UCalendarPlanStartTime" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'UCalendarPlanEndTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" onblur="setValueToHidden(UCalendarPlanStartTime,'_UCalendarPlanStartTime')" >
                    <input type="text" data-dojo-type="dijit/form/ValidationTextBox" name="starttime" class="Wdate" id="_UCalendarPlanStartTime" >                    
                </td>
            </tr>
            <tr>
                <td>
                    <label for="Uendtime">结束时间: </label>
                </td>
                <td>
                    <input style="width: 325px;" type="text" class="Wdate" id="UCalendarPlanEndTime" onClick="WdatePicker({minDate:'#F{$dp.$D(\'UCalendarPlanStartTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" onblur="setValueToHidden(UCalendarPlanEndTime,'_UCalendarPlanEndTime')" >
                    <input type="text" data-dojo-type="dijit/form/ValidationTextBox" name="endtime" class="Wdate" id="_UCalendarPlanEndTime" >
                </td>
            </tr>
        </table>
    </div>
  </div>
  <div class="dijitDialogPaneActionBar">
    <button data-dojo-type="dijit/form/Button" type="button" onclick="calendarplanSubmitForm('calendarplanUFD','u')">保存</button>
    <button data-dojo-type="dijit/form/Button" type="button" onclick="calendarplanRestForm('calendarplanUFD');">重置</button>
  </div>
</div>
<div data-dojo-type="dijit/Dialog" id="calendarplanFFD" title="详细内容">
  <div class="dijitDialogPaneContentArea">
    <input data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true, readOnly: true" type="text"
      name="planid" id="planid" style="display: none;">
    <input data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="status" id="calendarplanListfinish" style="display: none;">
    <table>
    <tr>
        <td><label for="assignername">分配人名: </label></td>
        <td><input style="width: 325px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="assignername"></td>
      </tr>
    <tr>
        <td><label for="fullname">员工名: </label></td>
        <td><input style="width: 325px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="fullname"></td>
      </tr>
    <tr>
    <!-- 0=一般、1=重要、2=紧急:  -->
        <td><label for="urgent">紧急程度:</label></td>
        <td><input style="width: 325px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="urgent"></td>
    </tr>
    <tr>
        <td><label for="content">内容: </label></td>
        <td>            
            <div style="width: 322px;height: 75px" name="content" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="readOnly: true"></div>
        </td>
    </tr>
    <tr>
        <td><label for="starttime">开始时间: </label></td>
        <td><input style="width: 325px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="starttime" ></td>
    </tr>
    <tr>
        <td><label for="endtime">结束时间: </label></td>
        <td><input style="width: 325px" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="readOnly: true" type="text"
          name="endtime"></td>
    </tr>
    
    </table>
    <div id="inputfeedback">
        <table>
	       <tr>
	            <td><label for="feedback">反馈意见: </label></td>
	            <td><input style="width: 322px;height: 75px" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="required: true,trim: true" type="text"
	              name="feedback" id="feedback"></td>   
	       </tr>
	    </table>
    </div>
    <div id="showfeedback">
        <table>
           <tr>
                <td><label for="_feedback">反馈意见: </label></td>
                <td><input style="width: 322px;height: 75px" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="readOnly: true" type="text"
                  name="_feedback" id="_feedback"></td>   
           </tr>
        </table>
    </div>  
  </div>
  <div class="dijitDialogPaneActionBar" id="CPLfinishBar">
    <button data-dojo-type="dijit/form/Button" type="button" onclick="calendarplanSubmitForm('calendarplanFFD','f')">完成</button>
  </div>
</div>
<fieldset>
  <legend>&nbsp;&nbsp;信息选项&nbsp;&nbsp;</legend>
  <form id="queryCalendarplanForm" data-dojo-type="dijit/form/Form" method="post">
    <div style="margin-left: 5px;">
      <table>
        <tr>
          <td><label for="starttime">开始时间: </label></td>
          <td width="200"><input style="width: 180px;" data-dojo-type="dijit/form/ValidationTextBox" name="starttime" class="Wdate" id="Cstarttime" onClick="WdatePicker({maxDate:'#F{$dp.$D(\'Cendtime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})"></td>
          <td><label for="endtime">结束时间: </label></td>
          <td width="200"><input style="width: 180px;" data-dojo-type="dijit/form/ValidationTextBox" name="endtime" class="Wdate" id="Cendtime" onClick="WdatePicker({minDate:'#F{$dp.$D(\'Cstarttime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss'})"></td>
          <!-- 0=一般、1=重要、2=紧急: -->
          <td><label for="urgent">紧急程度: </label></td>
          <td>
             <select data-dojo-type="dijit/form/Select" name="urgent" style="width: 100px;">
                 <option value="3">全部</option>
	             <option value="0">一般</option> 
	             <option value="1">重要</option>
	             <option value="2">紧急</option>
             </select>
         </td>
        </tr>
        <tr>
          <td><label for="content">内容: </label></td>
          <td><input data-dojo-type="dijit/form/TextBox" data-dojo-props="trim: true" type="text" name="content"></td>
          <!-- 0=未完成、1=完成:  -->          
          <td><label for="assignername">分配人名: </label></td>
          <td><input data-dojo-type="dijit/form/TextBox" data-dojo-props="trim: true" type="text" name="assignername"></td>
          <td><label for="status">状态：</label></td>
          <td>
              <select data-dojo-type="dijit/form/Select" name="status" style="width: 100px;">
                 <option value="2">全部</option>
                 <option value="0">未完成</option>
                 <option value="1">已完成</option>
             </select>
         </td>
        </tr>
      </table>
    </div>
  </form>
  <div style="padding: 5px;">
    <button id="calendarplanInsertBtn" data-dojo-type="dijit/form/Button" type="submit" label="新增">
      <script type="dojo/method" event="onClick" args="evt">
        dijit.byId('calendarplanIFD').show();
      </script>
    </button>
    <button id="calendarplanDeleteBtn" data-dojo-type="dijit/form/Button" type="button" label="删除" onclick="calendarplanDelete();"></button>
    <button id="calendarplanUpdateBtn" data-dojo-type="dijit/form/Button" type="button" label="更新">
      <script type="dojo/method" event="onClick" args="evt">
        var ids = jQuery("#calendarplanGird").jqGrid('getGridParam', 'selarrrow') || [];
        var carcheck = jQuery("#calendarplanGird").jqGrid('getRowData', ids[0]);
        var status=carcheck['status'];
        if (ids.length != 1) {
          alert('每次只能修改一条数据!');
        }else if(status.indexOf("已完成")!=-1){
          alert('不能修改已完成数据!');
        }else{
          var calendarplan = jQuery("#calendarplanGird").jqGrid('getRowData', ids[0]);
          dijit.byId('calendarplanUFD').setValues(calendarplan);
          document.getElementById("UCalendarPlanStartTime").value=dijit.byId('_UCalendarPlanStartTime').getValue();
          document.getElementById("UCalendarPlanEndTime").value=dijit.byId('_UCalendarPlanEndTime').getValue();
          dijit.byId('calendarplanUFD').show();
        }
      </script>
    </button>
    <button id="calendarplanQueryBtn" data-dojo-type="dijit/form/Button" type="button" label="查询"
      onclick="calendarplanQuery('queryCalendarplanForm');"></button>
  </div>
</fieldset>
<div id="gird">
  <table id="calendarplanGird"></table>
  <div id="calendarplanToolbar"></div>
</div>
<script type="text/javascript">   
    jQuery("#calendarplanGird").jqGrid({
        url : 'calendarplan/queryAsList',
        datatype : "json",
        autowidth : true,
        rownumbers : true,
        height : 'auto',
        colNames : [
          '日程ID',
          '开始时间',
          '结束时间',
          '紧急程度',
          '摘要',
          '内容',
          '员工ID',
          '执行人',
          '分配人ID',
          '分配人',
          '反馈意见',
          '显示方式',
          '任务类型',
          '状态'
        ],
        colModel : [ 
        {
          name : 'planid',
          index : 'planid',
          width : 60,
          key : true,
          hidden : true,
          align : 'center'
        },
        {
          name : 'starttime',
          index : 'starttime'
        },
        {
          name : 'endtime',
          index : 'endtime'
        },
        {
          name : 'urgent',
          index : 'urgent'
        },
        {
          name : 'summary',
          index : 'summary',
          hidden : true        
        },
        {
          name : 'content',
          index : 'content'
        },
        {
          name : 'userid',
          index : 'userid',
          hidden : true
        },
        {
          name : 'fullname',
          index : 'fullname'
        },
        {
          name : 'assignerid',
          index : 'assignerid',
          hidden : true        
        },
        {
          name : 'assignername',
          index : 'assignername'
        },
        {
          name : 'feedback',
          index : 'feedback',
          hidden : true
        },
        {
          name : 'showstyle',
          index : 'showstyle',
          hidden : true
        },
        {
          name : 'tasktype',
          index : 'tasktype'
        },
        {
          name : 'status',
          index : 'status'
        }
        ],
        rowNum : 15,
        rowList : [ 15, 20, 25, 30 ],
        pager : '#calendarplanToolbar',
        recordpos : 'right',
        viewrecords : true,
        sortorder : "desc",
        jsonReader : {
            repeatitems : false
        },
        gridComplete : function() {
            var ids = jQuery("#calendarplanGird").jqGrid('getDataIDs');
            for ( var i = 0; i < ids.length; i++) {
                var cl = ids[i];
                var carcheck = jQuery("#calendarplanGird").jqGrid('getRowData', cl);
                var unfinish="<a href='javascript:void(0);' onclick=\"showDetail(1"+",'"+cl+"')\">完成任务(未完成)</a>";
                var finish="<a href='javascript:void(0);' onclick=\"showDetail(0"+",'"+cl+"')\">查看详情(已完成)</a>";
                var mystatus = carcheck['status'] == '1' ? finish : unfinish;
                var myurgent = carcheck['urgent'] == '0' ? '一般' : (carcheck['urgent']=='1'?'重要':"紧急");
                var mytasktype = carcheck['tasktype'] == '1' ? '限期任务' : "非限期任务";
                
                jQuery("#calendarplanGird").jqGrid('setRowData', cl, {
                    status : mystatus,
                    urgent : myurgent,
                    tasktype :mytasktype
                });
            }
        },
        multiselect : true,
        shrinkToFit : false,
        caption : "日程管理列表"
    });
    
    jQuery("#calendarplanGird").jqGrid('navGrid', '#calendarplanToolbar', {
        edit : false,
        add : false,
        del : false,
        search : false,
        refresh : true
    });
</script>
